var netcore = require('../../../utils/network.js')
var tripleDes = require('../../../utils/CKCrypto.js')
var comm = require('../../../utils/comm_util.js')

function getShareInfo(callBack){
  var map=new Map()
  netcore.requestPost("appshare/getShare.do", map, function (success) {
    callBack(success)
  }, function (code, errMsg) {
    wx.showToast({
      title: errMsg,
      icon: ''
    })
  })
}
function getMyShareList(callBack){
  var map = new Map()
  netcore.requestPost("appshare/getMyShare.do", map, function (success) {
    success.forEach(function(item,index){
      item.sharedUserName = tripleDes.deCode(item.sharedUserName+"")
      item.rechargeTime = tripleDes.deCode(item.rechargeTime+"")
      item.rechargeAmount = tripleDes.deCode(item.rechargeAmount+'')
    })
    callBack(success)
  }, function (code, errMsg) {
    wx.showToast({
      title: errMsg,
      icon: ''
    })
  })
}
module.exports = {
  getShareInfo: getShareInfo,
  getMyShareList: getMyShareList
}